<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript">
	$(function() {
		var pid = "${param.pid}";
		var path = "${pdict.path}";
		$("#oldpath").val(path);
		if(pid!=null&&pid!="") {
			$("#dict-form").find("input[name='dict.pid']").val(pid);
			$("#dict-form").find("input[name='dict.path']").val(path);
		}
	})
	
	function changeDictPath(input) {
		var p1 = $(input).val();
		var p2 = $("#oldpath").val();
		$("#dict-form").find("input[name='dict.path']").val(p2+"/"+p1);
	}
</script>
<form id="dict-form">
	<input type="hidden" name="dict.id" value="${dict.id }">
	<input type="hidden" name="dict.pid" value="${dict.pid }">
	<input type="hidden" id="oldpath">
	<h3 class="thin underline">字典信息</h3>
	<p class="inline-label button-height">
		<label class="label">代码：</label>
		<input type="text" name="dict.code" class="input" value="${dict.code }" onblur="changeDictPath(this);">
	</p>
	<p class="inline-label button-height">
		<label class="label">键：</label>
		<input type="text" name="dict.name" class="input" value="${dict.name }">
	</p>
	<p class="inline-label button-height">
		<label class="label">值：</label>
		<input type="text" name="dict.value" class="input" value="${dict.value }">
	</p>
	<p class="inline-label button-height">
		<label class="label">属性1：</label>
		<input type="text" name="dict.attr1" class="input" value="${dict.attr1 }">
	</p>
	<p class="inline-label button-height">
		<label class="label">属性2：</label>
		<input type="text" name="dict.attr2" class="input" value="${dict.attr2 }">
	</p>
	<p class="inline-label button-height">
		<label class="label">路径：</label>
		<input type="text" name="dict.path" readonly="readonly" class="input" value="${dict.path }">
	</p>
</form>
